<template>
	<view>
		<!-- 这是自定义的搜索组件 -->
		<view class="container" :style="{ backgroundColor: bgcolor }">
			<view class="search-box" :style="{ 'border-radius': radius }" @click="gotoSearch">
				<uni-icons type="search" size="17"></uni-icons>
				<text>搜索</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'my-search',
	data() {
		return {}
	},
	props: {
		bgcolor: {
			type: String,
			default: '#c00000'
		},
		radius: {
			type: String,
			default: '18px'
		}
	},
	methods: {
		gotoSearch() {
			this.$emit('myClick')
		}
	}
}
</script>

<style lang="scss" scoped>
.container {
	display: flex;
	align-items: center;
	padding: 0 20rpx;
	height: 100rpx;
	// background-color: #c00000;
	.search-box {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 72rpx;
		background-color: white;

		text {
			font-size: 30rpx;
			margin-left: 20rpx;
		}
	}
}
</style>
